package com.xhapi.controller;

import com.xhapi.pojo.entity.ApiResult;
import com.xhapi.service.Neo4jGeoService;
import com.xhapi.utils.ApiResultHandler;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequiredArgsConstructor
@RequestMapping("/mapGeo")
public class Neo4jGeoController {
    private final Neo4jGeoService neo4jGeoService;
    @GetMapping
    public ApiResult getAllMap(){
        return ApiResultHandler.success(neo4jGeoService.getAllMap());
    }

    @GetMapping("/update")
    public ApiResult updateMap(@RequestParam List<String> nameList){
        neo4jGeoService.updateMap(nameList);
        return ApiResultHandler.success();
    }
}
